/*************************************************************************
	> File Name: 005.判断数字是否为素数.c
	> Author: Maureen 
	> Mail: Maureen@qq.com 
	> Created Time: 日  8/22 20:40:03 2021
 ************************************************************************/

#include <stdio.h>

//时间复杂度：O(logn)
//如果n = a * b, 那么一定有 a <= √n 且 b <= √n

int isPrime(int n) {
    for (int i = 2; i * i <= n; i++) {
        if (n % i == 0) return 0;
    }
    return 1;
}

int main() {
    int n;
    scanf("%d", &n);
    if (isPrime(n)) printf("%d is prime!\n", n);
    else printf("%d is not prime!\n", n);

    return 0;
}
